<?php 

class indexView {
	
	public static function displayRess($tmp) {
		echo $tmp->getName() . 
				" - Menge: " . 
				$tmp->getAmount() . 
				" Stk/h - Preis: " . 
				$tmp->getPrice() . 
				" G/Stk - Ergebnis: " . 
				$tmp->getValue() .
				" G/h<br />"; 
		
	}

	public static function displayRessOverview($level, building $building) {
		echo "<span style='text-decoration:underline'>Gewinn auf Level $level: " . 
				$building->productionValue($level) . 
				" G/h</span><br /><br />";
				
		$tmp = $building->getProduction($level);
		$tmp2 = $building->getMats($level);
		
		echo "<span style='color:#000066' />" .
			"Verkauf<br />";
		 
		indexView::displayRess($tmp);
		
		echo "</span>";
		
		if(!empty($tmp2)) {
			
			echo "<br />" .
			"<span style='color:#660000' />" .
			"Einkauf<br /> ";			
			
			foreach($tmp2 as $v2) {
				indexView::displayRess($v2);
			}
			
			echo "</span>";
		}
		
		echo "<br /><br />";
	}
}

?>